home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Misc / msql-1.0.6 / src / common / ualarm.c < prev   
C/C++ Source or Header  |  1994-09-07  |  890b  |  47 lines

  1. /*
  2. **    ualarm.c    - 
  3. **
  4. **
  5. ** Copyright (c) 1993  David J. Hughes
  6. **
  7. ** Permission to use, copy, and distribute for non-commercial purposes,
  8. ** is hereby granted without fee, providing that the above copyright
  9. ** notice appear in all copies and that both the copyright notice and this
  10. ** permission notice appear in supporting documentation.
  11. **
  12. ** This software is provided "as is" without any expressed or implied warranty.
  13. **
  14. */
  15.  
  16.  
  17. #ifndef lint
  18. static char RCSid[] = 
  19.     "ualarm.c,v 1.2 1994/07/05 02:01:00 bambi Exp";
  20. #endif 
  21.  
  22.  
  23.  
  24. #include<sys/time.h>
  25.  
  26. #include <common/portability.h>
  27.  
  28.  
  29. #ifndef HAVE_UALARM
  30.  
  31.  
  32. ualarm(val, interval)
  33.     unsigned    val,
  34.             interval;
  35. {
  36.     struct    itimerval    value;
  37.  
  38.     value.it_interval.tv_sec = 0;
  39.     value.it_interval.tv_usec = (long) interval;
  40.     value.it_value.tv_sec = 0;
  41.     value.it_value.tv_usec = (long) val;
  42.     setitimer(ITIMER_REAL,&value,(struct itimerval *)0);
  43. }
  44.  
  45.  
  46. #endif
  47.